<script setup>
import {baseStore} from "@/store/baseStore.js";
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'

let bs = baseStore()
let {localState, getLocalState} = storeToRefs(bs)
const {locale} = useI18n();

onMounted(() => {
    zhCn.name = 'zh'
    localState.value = getLocalState.value ? getLocalState.value : zhCn
    locale.value = localState.value.name
})

watch(localState, (newValue, oldValue) => {
    locale.value = newValue.name
})
</script>

<template>
    <el-config-provider :locale="localState">
        <router-view></router-view>
    </el-config-provider>
</template>

<style scoped>

</style>
